<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8" />
    <title>一键提现</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta content="width=device-width, initial-scale=1" name="viewport" />
    <link href="css/base.css" rel="stylesheet" type="text/css" />
    <link href="css/button.css" rel="stylesheet" type="text/css" />
    <link href="css/icon.css" rel="stylesheet" type="text/css" />
    <link href="css/withdrawals.css" rel="stylesheet" type="text/css" />
</head>

<body>
    <div class="form-body">
        <form action="">
            <div class="form-item">
                <span class="item-title">账户</span>
                <a class="item-action ai" href="javascript:;">
                    <input type="text" name="account_id" readonly class="control-text" placeholder="存款地方">
                    <i class="icon icon-down"></i>
                </a>
            </div>
            <div class="form-item">
                <span class="item-title">金额</span>
                <a class="item-action" href="javascript:;">
                    <input type="text" name="money" class="control-text" placeholder="你想提多少">
                    <i class="icon icon-cross"></i>
                </a>
            </div>
        </form>
    </div>
    <button class="btn btn-submit sbm yellow">提现申请</button>
    <script src="js/jquery.min.js" type="text/javascript"></script>
    <script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js" type="text/javascript"></script>
    <script src="js/template.js" type="text/javascript"></script>
    <script src="js/dialog.js" type="text/javascript"></script>
    <script src="js/base.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function() {
            bee.wxConfig(function() {
                bee.hideAllNonBaseMenuItem();
            }, function(res) {});

            $('body').on('click', '.ai', function() {
                $('.dialog').dialog('show');
            });

            $('body').on('click', '.close', function() {
                $('.dialog').dialog('hide');
            });

            $('body').on('click', '.ok', function() {
                var text = $('.dialog .icon-dot').parent().text();
                $('[name="account_id"]').val(text);
                $('.dialog').dialog('hide');
            });

            $('body').on('click', '.sbm', function() {
                var data = {};
                data.account_id = $('.dialog .icon-dot').attr('data-id');
                data.money = $('[name="money"]').val();
                bee.request({
                    url: '/Member/Index/withdrawals',
                    data: data,
                    success: function(rs) {
                        bee.open('person.html');
                    }
                });
            });

            bee.request({
                url: '/Member/Index/withdrawals_account_list',
                data: null,
                success: function(result) {
                    bee.template('account', result);
                    $('body').on('click', '.dialog .icon', function() {
                        $('.dialog .icon').removeClass('icon-dot').addClass('icon-dot-blank');
                        $(this).removeClass('icon-dot-blank').addClass('icon-dot');
                    });
                }
            });
        });
    </script>
    <div class="dialog">
        <div class="dialog-title">选择一个账户吧～</div>
        <div class="dialog-body">
            <ul id="account-dom">
                <li><a class="font-blue" href="bank.html">前往绑定银行账户</a></li>
            </ul>
            <script id="account" type="text/html">
                {{each list}}
                <li><i data-id="{{ $value.id }}" class="icon {{if $index === 0 }}icon-dot{{else}}icon-dot-blank{{/if}}"></i> {{ $value.type_name }}</li>
                {{/each}}
            </script>
        </div>
        <div class="dialog-foot">
            <a href="javascript:;" class="font-red ok">确认</a>
            <a href="javascript:;" class="font-blue close" style="margin-left: 40%;">关闭</a>
        </div>
    </div>
</body>

</html>
